Changes made to the way Visual Architect generates document classes will require some source changes to the Process Monitor tutorial in order to get the application to link. These steps are outlined below:
If you are starting the Process Monitor tutorial for the first time:
- Remove the file "CSaver_class.cpp" from the project. This file
won't be generated by Visual Architect 7.0.3--instead it generates
two files called "CSaver_CProcessListOnly.cpp" and
"CSaver_CMain.cpp"
- Find the file called ItsContents_CProcessListOnly.h (it's in the
Source folder with the other generated files) and open it in the
editor
- Comment out the line that reads:
#pragma template CSaver<CCollaborator>
Why the changes?
----------------
If you don't comment out the #pragma template expansion, you'll find that you'll get a link error for multiply defined instances of CSaver<CCollaborator>. Typically each document type that you have saves a different object class, and each one instantiates a version of CSaver. In this case, both documents have CCollaborator as their ItsContents class, so they both try to expand the CSaver template. The linker only wants one of them, however, and that's why the error appears.
For more details on the changes to Visual Architect in version 7.0.3, refer to the Visual Architect README that came with the 7.0.3 patch.